<template>
	<view>
		<u-loading-page :loading="loading" loading-text="正在跳转..." loading-mode="spinner" icon-size="36" bg-color="#e8e8e8" loading-color="#000000"></u-loading-page>
	</view>
</template>

<script>
import { orcodePromotion } from '@/api/exhibition/exhibition.js';
export default {
	data() {
		return {
			loading: true
		};
	},
	onLoad(option) {
		console.log('option', option);
		orcodePromotion({ id: option.id }).then(res => {
			this.loading = false;
			if (res.code == 0) {
				// 0 不跳转，1：外部跳转，2：内部跳转
				if (res.type == 0) {
					return;
				} else if (res.type == 1) {
					uni.reLaunch({
						url: res.url
					});
				} else if (res.type == 2) {
					uni.reLaunch({
						url: '/subPages/web_view_h5/index?url=' + encodeURIComponent(res.url)
					});
				} else if (res.type == 3) {
					// 跳转视频号直播
					util.channelsLice();
				}
			} else {
				uni.$u.toast(res.msg);
				setTimeout(() => {
					uni.reLaunch({
						url: '/pages/home/index'
					});
				}, 1500);
			}
		});
	}
};
</script>

<style></style>
